﻿using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

namespace UFrame.TableCfg
{
    [System.Serializable]
    public class GuideStepCfg : IRow
    {
        public int ID { get { return id; } }
/*0*/   public int id { get; private set; } //GuideStepCfg
/*1*/   public int step_index { get; private set; } //引导步骤index
/*2*/   public string step_name { get; private set; } //步骤名
/*3*/   public int action_factor { get; private set; } //执行
/*4*/   public int[] start_factors { get; private set; } //启动条件
/*5*/   public int[] end_factors { get; private set; } //结束条件
        public void SetData(string[] array)
        {
            var arrayLen = array.Length;
            if (arrayLen > 0 && !string.IsNullOrEmpty(array[0])) id = Convert.ToInt32(array[0]);
            if (arrayLen > 1 && !string.IsNullOrEmpty(array[1])) step_index = Convert.ToInt32(array[1]);
            if (arrayLen > 2) step_name = array[2];
            if (arrayLen > 3 && !string.IsNullOrEmpty(array[3])) action_factor = Convert.ToInt32(array[3]);
            if (arrayLen > 4) start_factors = UConvert.TointArray(array[4]);
            if (arrayLen > 5) end_factors = UConvert.TointArray(array[5]);
        }
    }
}
